<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>修改设备检修记录</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <style>
    .layui-form-label{
      width: 120px;
    }
    .basicInfo .layui-form-item{
      margin-bottom: 15px !important;
    }
  </style>
</head>
<body>
  <div style="margin: 20px;">
    <div class="basicInfo">
      <div class="record-formtitle">基本信息</div>
      <div class="layui-row form-row">
        <div class="layui-col-md6">
          <div class="layui-form-item">
            <div class="itemTr">站台名称:<span id="stationName"></span></div>
        </div>
        <div class="layui-form-item">
            <div class="itemTr">系统名称:<span id="systemValue"></span></div>
        </div>
        <div class="layui-form-item">
            <div class="itemTr">设备类型:<span id="devTypeValue"></span></div>
        </div>
        </div>
        <div class="layui-col-md6">
          <div class="layui-form-item">
            <div class="itemTr">专业:<span id="specialtyValue"></span></div>
        </div>
        <div class="layui-form-item">
            <div class="itemTr">设备名称:<span id="productName"></span></div>
        </div>
        <div class="layui-form-item">
            <div class="itemTr">维修方式:<span id="maintenanceFlag"></span></div>
        </div>
    </div>
    </div>
    <div class="layui-form" lay-filter="recordEditForm" id="layuiadmin-form-role">
      <div class="record-formtitle">更新维修记录</div>
      <div class="layui-row form-row addPlanForm">
        <div class="layui-col-md6">
          <div class="layui-form-item">
            <label class="layui-form-label">检修日期:</label>
            <div class="layui-inline">
                <i class="layui-icon layui-icon-date"></i>
                <input type="text" name="maintainDate"  autocomplete="off" class="layui-input" id="maintainDate" style="padding-right: 30px">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">检修人:</label>
            <div class="layui-inline">
              <input type="text" name="maintainPerson" class="layui-input" style="padding-right: 30px" lay-verify="required">
            </div>
          </div>
        </div>
        <div class="layui-col-md6">
          <div class="layui-form-item">
            <label class="layui-form-label">检修方式:</label>
            <div class="layui-inline">
              <input type="text" name="maintainWay" class="layui-input" style="padding-right: 30px" lay-verify="required" value="检修">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">检修状态:</label>
            <div class="layui-inline">
              <select name="taskStatu" id="statusList" lay-filter="statusListFilter">
                <option value="">请选择</option>
              </select>
            </div>
          </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">检修内容：</label>
        <div class="layui-input-block" style="margin-left: 150px;">
            <input type="text" name="maintainContent" class="layui-input" lay-verify="required">
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">具体描述</label>
      <div class="layui-input-block" style="margin-left: 150px;">
        <textarea type="text" name="describe" lay-verify="required" autocomplete="off" class="layui-textarea"></textarea>
      </div>
    </div>
    <div class="layui-form-item layui-hide">
      <input type="button" lay-submit lay-filter="recordSubmit" id="recordSubmit" value="确认添加">
      <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="确认编辑">
    </div>

    </div>
    
  </div>
    <script src='../../layuiadmin/modules/jTools.js'></script>
    <script src="../../layuiadmin/layui/layui.js"></script> 
    <script>
      function initData(data){
        var taskNum = data.taskNum;
        layui.config({
          base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
          index: 'lib/index' //主入口模块
          , my_send: '../myModules/my_send'
        }).use(['index', 'form','laydate','table','my_send'], function () {
          var $ = layui.$
          , form = layui.form
          ,laydate = layui.laydate
          ,table = layui.table
          , my_send = layui.my_send
          , http_proxy = layui.http_proxy;
          laydate.render({
              elem: '#maintainDate'
              ,type: 'datetime'
          });
          //处理状态
          $.ajax({
              type : "get",
              async : false, //异步执行
              url : http_proxy("/devStatus/getStatus"),
              dataType : "json", //返回数据形式为json
              success : function(data) {
                  $.each(data.result,function(index,item){
                      $('#statusList').append(new Option(item.label,item.value));
                  })
                  form.render('select');
              },
              error : function(errorMsg) {
                  alert("请求数据失败");
              }
          });
          $('#stationName').html(data.stationName);
          $('#systemValue').html(data.systemName);
          $('#productName').html(data.eventName);
          $('#devTypeValue').html(data.eventType);
          $('#specialtyValue').html(data.domain);
          $('#maintenanceFlag').html(data.maintainWay === '1' ? '计划维修':'检修');
          form.val("recordEditForm", {
            'maintainDate':data.maintainDate,
            'maintainPerson':data.maintainPerson,
            'maintainWay':data.maintainWay,
            'taskStatu':data.taskStatu,
            'maintainContent':data.maintainContent,
            'describe':data.describe,
          });
          // form.render('select');
        })
      }
    </script> 
</body>
</html>